<!--
 * Description: table view 组件
 * Company: 联宝（合肥）电子科技有限公司
 * Author: Qiuxue.Wu
 * Date: 2020/08/12 15:28
-->

<template>
  <div class="issue-view" style="padding-left:20px">
    <!--数据表单-->
    <el-form label-position="left" label-width="130px" :model="rowData" size="mini">
      <el-row>
        <!--问题名称-->
        <el-col :span="24">
          <el-form-item :label="$t('Issue.issueName')">
            <span>{{ rowData.issueName }}</span>
          </el-form-item>
        </el-col>
        <!--问题类型-->
        <el-col :span="12">
          <el-form-item :label="$t('Issue.issueType')">
            <span>
              {{ $store.getters['dict/dictValueByParent']('IssueType', rowData.issueType) }}
            </span>
          </el-form-item>
        </el-col>
        <!--问题状态-->
        <el-col :span="12">
          <el-form-item :label="$t('Issue.issueStatus')">
            <span>
              {{ $store.getters['dict/dictValueByParent']('IssueStatus', rowData.issueStatus) }}
            </span>
          </el-form-item>
        </el-col>
        <!--问题优先级-->
        <el-col :span="12">
          <el-form-item :label="$t('Issue.issueLevel')">
            <span>
              {{ $store.getters['dict/dictValueByParent']('IssueLevel', rowData.issueLevel) }}
            </span>
          </el-form-item>
        </el-col>
        <!--问题创建人-->
        <el-col :span="12">
          <el-form-item :label="$t('Issue.issueCreateUser')">
            <span>
              {{
                $store.getters['user/getUserNameById'](rowData.issueCreateUser) ||
                  $t('result.unknown')
              }}
            </span>
          </el-form-item>
        </el-col>
        <!--问题负责人-->
        <el-col :span="12">
          <el-form-item :label="$t('Issue.issueAppointUser')">
            <span>
              {{
                $store.getters['user/getUserNameById'](rowData.issueAppointUser) ||
                  $t('result.unknown')
              }}
            </span>
          </el-form-item>
        </el-col>
        <!--创建时间-->
        <el-col :span="12">
          <el-form-item :label="$t('Issue.issueCreateTime')">
            <span>{{ rowData.issueCreateTime }}</span>
          </el-form-item>
        </el-col>
        <!--指派时间-->
        <el-col :span="12">
          <el-form-item :label="$t('Issue.issueAppointTime')">
            <span>{{ rowData.issueAppointTime }}</span>
          </el-form-item>
        </el-col>
        <!-- 预计解决时间 -->
        <el-col :span="12">
          <el-form-item :label="$t('Issue.issueEstimateTime')">
            <span>{{ rowData.issueEstimateTime }}</span>
          </el-form-item>
        </el-col>
        <!-- 解决时间 -->
        <el-col :span="12">
          <el-form-item :label="$t('Issue.issueResolveTime')">
            <span>{{ rowData.issueResolveTime }}</span>
          </el-form-item>
        </el-col>
        <!--备注信息-->
        <el-col :span="24">
          <el-form-item :label="$t('Issue.issueRemark')">
            <span>{{ rowData.issueRemark }}</span>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <!-- 富文本显示 -->
    <ViewRichText :issueDesc="issueDesc" />
  </div>
</template>
<script>
import ViewRichText from '@/widgets/ViewRichText'

export default {
  name: 'TableView',
  components: { ViewRichText },
  props: {
    rowData: {
      type: Object,
      default: () => null
    },
    issueDesc: {
      default: '',
      type: String
    }
  },
  methods: {
    preView() {
      this.$bus.$emit('rich-view', this.issueDesc)
    }
  }
}
</script>

<style lang="scss" scoped>
.issue-view {
  text-align: left;
}
.el-form-item__content span {
  margin-left: 5px;
  color: blue;
}
/deep/.el-form-item__content {
  padding-right: 5px !important;
}
</style>
